<template>
  <div>ComModule</div>
  <div v-for="(item, index) in todos" :key="index">
    {{ item.id }} - {{ item.name }} - {{ item.completed }}
  </div>
</template>

<script lang="ts" setup>
import { computed, defineProps } from 'vue'
import { useStore } from 'vuex'
import { key } from '../store'
const store = useStore(key)
const todos = computed(() => store.state.todos?.todos)
// todos的初始化操作
store.dispatch('todos/initTodo')
</script>

<style></style>